import request from '@/utils/request'

// 查询存储每日发车安排列表
export function listSchedule(query) {
  return request({
    url: '/infomanagement/schedule/list',
    method: 'get',
    params: query
  })
}

// 查询存储每日发车安排详细
export function getSchedule(id) {
  return request({
    url: '/infomanagement/schedule/' + id,
    method: 'get'
  })
}

// 新增存储每日发车安排
export function addSchedule(data) {
  return request({
    url: '/infomanagement/schedule',  
    method: 'post',
    data: data
  })
}

// 修改存储每日发车安排
export function updateSchedule(data) {
  return request({
    url: '/infomanagement/schedule',
    method: 'put',
    data: data
  })
}

// 删除存储每日发车安排
export function delSchedule(id) {
  return request({
    url: '/infomanagement/schedule/' + id,
    method: 'delete'
  })
}

// 根据driverId查询发车安排和相关信息
export function getScheduleByDriverId(driverId) {
  return request({
    url: '/infomanagement/schedule/driver/' + driverId,
    method: 'get'
  })
}
